import dayjs from "dayjs";
const ybRequestTemplate = {
    method: 'post',
    url: '/eapdomain/callService',
    host: '10.114.177.55:8080',
    headers: {
        hsf_signature: '',
        fixmedins_code: '',
        infosyscode: '',
        hsf_timestamp: dayjs().unix().toString(),
        hsf_nonce: generateRandomString(),
    },
    body: {
        infno: "",
        msgid: '',
        mdtrtarea_admvs: '',
        insuplc_admdvs: "",
        recer_sys_code: "007",
        dev_no: "",
        dev_safe_info: "",
        cainfo: "",
        signtype: "",
        infver: 'V1.45',
        opter_type: "1",
        opter: '',
        opter_name: '',
        inf_time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        fixmedins_code: '',
        fixmedins_name: '',
        sign_no: "",
        input: {
            data: {
                mdtrt_cert_type: "",
                mdtrt_cert_type3: "",
                mdtrt_cert_no: "",
                card_sn: "",
                begntime: dayjs().format('YYYY-MM-DD'),
                psn_cert_type: "",
                certno: "",
                psn_name: ""
            }
        }
    }
};
function generateRandomString(length = 32) {
    const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    let result = '';
    for (let i = 0; i < length; i++) {
        result += chars.charAt(Math.floor(Math.random() * chars.length));
    }
    return result;
}

export { ybRequestTemplate };